import CSYNAC.Server as SERVER
import argparse
import os
print(f"starting on pid:{os.getpid()}")
parser = argparse.ArgumentParser()
parser.add_argument("-o","--option",help="option of the action")
parser.add_argument("-t","--target",help='The ip of the target')
parser.add_argument("-p","--port",type=int,help="The listening port of the target")
parser.add_argument("-l","--lpath",help="local path of the Mapping folder")
parser.add_argument("-r","--rpath",help="remote path of the Mapping folder")
parser.add_argument("--nodename",help="The name of the node")
parser.add_argument("--hostname",help='The name of the host')

args = parser.parse_args()

if args.option=='init':
    pass
elif args.option=='push':
    pass
elif args.option=='pull':
    pass
elif args.option=='hpush':
    pass
elif args.option=='start':
    port = args.port
    cserver = SERVER.CentralServer(port=port)
    cserver.start(back='processing')
elif args.option=='stop':
    port = args.port
    SERVER.close_remote("127.0.0.1",port)
else:
    print("Please input right option")